package com.dg11185.nearshop.net.weixin;

import com.dg11185.libs.utils.MD5.MD5Utils;
import com.dg11185.nearshop.net.HttpCacheRequest;

public class TabloidRequest extends HttpCacheRequest<TabloidResponse> {

    private static final String URL = "http://192.183.3.181/weixin/Index/index.php/";

    private static final String URL_STRING = "http://weixin.dg11185.com/Index/index.php/";
    private static final String METHOD = "News_chshAPI/getSourceNews/";

    private static final String SIGN_KEY = "qwertyuiop";

    public TabloidRequest(String date, String order) {
        super(URL_STRING + METHOD, "date/" + date + "/order/"+ order + "/sign_key/" + MD5Utils.getMD5Str(date+ order + SIGN_KEY));
    }

    @Override
    protected TabloidResponse parseJson(String response) throws Exception {
        TabloidResponse r = new TabloidResponse();
        r.parseJson(response);
        return r;
    }
}
